Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

feat(mobile): add extended wd commands for appium #3326

Closed
wants to merge 1 commit into from

Conversation

sjelin
Copy link
Contributor

@sjelin sjelin commented Jul 1, 2016

No description provided.

@sjelin
Copy link
Contributor Author

sjelin commented Jul 1, 2016

Had to add a lot of types to promises to get everything to compile

@juliemr
Copy link
Member

juliemr commented Jul 6, 2016

Can we split this into two PRs, one to add the promise types and one to actually do the extend webdriver business?

@sjelin
Copy link
Contributor Author

sjelin commented Jul 6, 2016

#3333

@juliemr
Copy link
Member

juliemr commented Jul 20, 2016

I believe this is unblocked now, changing labels.

@sjelin
Copy link
Contributor Author

sjelin commented Aug 2, 2016

Yeah, it was broken, not blocked. Should be fixed now. We'll see what travis says in the morning.

@sjelin sjelin changed the title feat(mobile): add extended wd commands for appium (WIP) feat(mobile): add extended wd commands for appium Aug 2, 2016
@sjelin
Copy link
Contributor Author

sjelin commented Aug 2, 2016

But honestly it's probably gonna need some cleaning regardless

@sjelin
Copy link
Contributor Author

sjelin commented Aug 8, 2016

Just gonna make sure I didn't screw up doc generation and then this PR will be good to go

@sjelin sjelin changed the title (WIP) feat(mobile): add extended wd commands for appium feat(mobile): add extended wd commands for appium Aug 9, 2016
@sjelin
Copy link
Contributor Author

sjelin commented Aug 9, 2016

@juliemr ready for review

try {
extendWDInstance = extendWD(webdriverInstance);
} catch (e) {
// Must not have a driver that can be extended (e.g. directly provided)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does 'directly provided' mean here? Can you add to the comment?

@cnishina
Copy link
Member

cnishina commented Dec 6, 2016

I'll take a look at this today...

*/
driver: WebDriver;
driver: ExtendedWebDriver;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is taken care of. This does not appear to have typing implications.

@sjelin sjelin force-pushed the extend-wd branch 3 times, most recently from da69654 to 09c3ddc Compare December 7, 2016 22:27
@sjelin
Copy link
Contributor Author

sjelin commented Dec 7, 2016

@cnishina can I get a re-review?

@sjelin
Copy link
Contributor Author

sjelin commented Dec 7, 2016

This is what the website looks like btw:


screen shot 2016-12-07 at 14 01 29


screen shot 2016-12-07 at 14 30 20

@@ -61,6 +62,11 @@ export class Webdriver {
opt_message?: string) => wdpromise.Promise<any>;
}

export class ExtendedWebdriver {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit on naming: We are importing ExtendedWebDriver interface and also have an ExtendedWebdriver class? By chance could this class be called something else? I almost thought these were the same thing because they differ by d vs D. Maybe WebDriverExtended?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, should this extend Webdriver above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. For consistency, I'll rename Webdriver to AbstractWebDriver and this to AbstractExtendedWebDriver
  2. Yes

@@ -114,15 +120,15 @@ function buildElementHelper(browser: ProtractorBrowser): ElementHelper {
/**
* @alias browser
* @constructor
* @extends {webdriver.WebDriver}
* @extends {webdriver_extensions.ExtendedWebDriver}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this extends the class above and not really the webdriver_extensions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order for js doc to work, this is the correct type (see old version pointing to webdriver.WebDriver not Webdriver)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Alright, that makes sense.

@@ -972,4 +986,7 @@ export class ProtractorBrowser extends Webdriver {
untrackOutstandingTimeouts?: boolean): ProtractorBrowser {
return new ProtractorBrowser(webdriver, baseUrl, rootElement, untrackOutstandingTimeouts);
}

// Extended webdriver methods
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove this comment since there are no methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :P

Copy link
Contributor Author

@sjelin sjelin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replied to comments, will implement in a second

@@ -114,15 +120,15 @@ function buildElementHelper(browser: ProtractorBrowser): ElementHelper {
/**
* @alias browser
* @constructor
* @extends {webdriver.WebDriver}
* @extends {webdriver_extensions.ExtendedWebDriver}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order for js doc to work, this is the correct type (see old version pointing to webdriver.WebDriver not Webdriver)

@@ -972,4 +986,7 @@ export class ProtractorBrowser extends Webdriver {
untrackOutstandingTimeouts?: boolean): ProtractorBrowser {
return new ProtractorBrowser(webdriver, baseUrl, rootElement, untrackOutstandingTimeouts);
}

// Extended webdriver methods
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :P

@@ -61,6 +62,11 @@ export class Webdriver {
opt_message?: string) => wdpromise.Promise<any>;
}

export class ExtendedWebdriver {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. For consistency, I'll rename Webdriver to AbstractWebDriver and this to AbstractExtendedWebDriver
  2. Yes

@cnishina
Copy link
Member

cnishina commented Dec 8, 2016

Please rebase with changes.

@sjelin
Copy link
Contributor Author

sjelin commented Dec 13, 2016

All comments addressed

Had to make some minor changes to the website to handle longer inheritance
chains
// have to be removed.
patch(
require('selenium-webdriver/lib/command'), require('selenium-webdriver/executors'),
require('selenium-webdriver/http'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the new types, could we import these with

import * as http from 'selenium-webdriver/http';
import * as executors from 'selenium-webdriver/executors';

?

@sjelin sjelin closed this Dec 21, 2016
@sjelin
Copy link
Contributor Author

sjelin commented Dec 21, 2016

Closed in favor of #3860

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants